export const traverseMultiDimArray = (
  arr: any[][],
  callback: (item: any, index: number) => void,
) => {
  if (!Array.isArray(arr)) {
    throw new Error("传入的参数必须为数组");
  }
  for (let i = 0; i < arr.length; i++) {
    const item = arr[i];
    if (Array.isArray(item)) {
      traverseMultiDimArray(item, callback);
    } else {
      callback(item, i);
    }
  }
};
